// Easing equation, borrowed from jQuery easing plugin
// http://gsgd.co.uk/sandbox/jquery/easing/
jQuery.easing.easeOutQuart = function (x, t, b, c, d) {
    return -c * ((t=t/d-1)*t*t*t - 1) + b;
};
jQuery.easing.easeOutCirc = function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
};
jQuery(function( $ ){
    
   
  
	    $('#left_slider').serialScroll({ 
        items:'li',
        prev:'#buttons2 a.prev',
        next:'#buttons2 a.next', 
        offset:0, //when scrolling to photo, stop 230 before reaching it (from the left)
        start:0, //as we are centering it, start at the 2nd
        duration:1200,
        force:true,
        stop:true,
        lock:false,
        cycle:false, //don't pull back once you reach the end
        easing:'easeOutQuart', //use this easing equation for a funny effect
        jump: false, //click on the images to scroll to them
		
		onBefore:function( e, elem, $pane, $items, pos ){
            e.preventDefault();
            if( this.blur )
                this.blur();
			$('#buttons2 a').removeClass('active');
			switch (pos) { 
				case $items.length-1:
					$('#bacheca_freccia_sx').addClass('active');
					break; 
				case 0:
					$('#bacheca_freccia_dx').addClass('active');
					break; 	
				default:
					$('#bacheca_freccia_sx').addClass('active');
					$('#bacheca_freccia_dx').addClass('active'); 
					break; 	
					}

        },
        onAfter:function( elem ){
            //'this' is the element being scrolled ($pane) not jqueryfied
        }

    });
		

 
    /**
     * The call below, is just to show that you are not restricted to prev/next buttons
     * In this case, the plugin will react to a custom event on the container
     * You can trigger the event from the outside.
     */
    
	
});



